From 8019cf6ca10af3cfba0e7c0c8a1440239d707659 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Mon, 14 Jun 2004 10:27:13 +0000 Subject: [PATCH] bitkeeper revision 1.960 (40cd7d81VzO6ptRUDTX_VC8yOFY9Ag) Makefile cleanups. We now have a LINUX_SRC_PATH as well as LINUX_SRC in the top level makefile. New make targets 'linux_XXX_config' and 'linux_XXX' configure and build from the appropriate linux defconfig file. 'install' should install both xen, the tools, and linux-xen. Alson rename xen.dbg -> xen-syms --- BitKeeper/etc/ignore | 1 + Makefile | 41 +++++++++++++++-------- linux-2.4.26-xen-sparse/arch/xen/Makefile | 18 +++++----- tools/Makefile | 2 +- xen/Makefile | 4 +-- xen/arch/x86/Makefile | 4 +-- 6 files changed, 41 insertions(+), 29 deletions(-) diff --git a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore index cf002e46db..57e5a0da4b 100644 --- a/BitKeeper/etc/ignore +++ b/BitKeeper/etc/ignore @@ -29,3 +29,4 @@ xen/tools/elf-reloc xen/tools/figlet/figlet xen/xen xen/xen.* +xen/xen-syms diff --git a/Makefile b/Makefile index 3243d346b4..97b07673f3 100644 --- a/Makefile +++ b/Makefile @@ -18,34 +18,47 @@ dist: all $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C tools install LINUX_VER ?= $(shell ( /bin/ls -ld linux-*-xen-sparse ) 2>/dev/null | sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' ) -LINUX_SRC ?= linux-$(LINUX_VER).tar.gz LINUX_CONFIG_DIR ?= $(INSTALL_DIR)/boot - -pristine-linux-src: - [ -e $(LINUX_SRC) ] || wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-$(LINUX_VER).tar.gz -O- > $(LINUX_SRC) +LINUX_SRC_PATH ?= .:.. +LINUX_SRC_X ?= $(firstword $(foreach dir,$(subst :, ,$(LINUX_SRC_PATH)),$(wildcard $(dir)/linux-$(LINUX_VER).tar.gz))) + +pristine-linux-src: +ifneq ($(LINUX_SRC),) + @[ -r "$(LINUX_SRC)" ] || (echo "Can not find linux src at $(LINUX_SRC)" && false) +LINUX_SRC_X = $(LINUX_SRC) +else +ifeq ($(LINUX_SRC_X),) + @echo "Can not find linux-$(LINUX_VER).tar.gz in path $(LINUX_SRC_PATH)" + @wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-$(LINUX_VER).tar.gz -O./linux-$(LINUX_VER).tar.gz +LINUX_SRC_X = ./linux-$(LINUX_VER).tar.gz +endif +endif linux-$(LINUX_VER)-xen: pristine-linux-src $(RM) -rf linux-$(LINUX_VER)-xen - tar -x -z -f $(LINUX_SRC) + tar -x -z -f $(LINUX_SRC_X) mv linux-$(LINUX_VER) linux-$(LINUX_VER)-xen ( cd linux-$(LINUX_VER)-xen-sparse ; ./mkbuildtree ../linux-$(LINUX_VER)-xen ) -config_%: linux-$(LINUX_VER)-xen +linux_%_config: $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen mrproper - cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst config_,,$(@)) .config || $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen $(subst config_,,$(@))_config + cp $(LINUX_CONFIG_DIR)/config-$(LINUX_VER)-$(subst _config,,$(subst linux_,,$(@))) .config || $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen $(subst linux_,,$(@)) $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen oldconfig $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen dep -build_%: - $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen bzImage - $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_NAME=$(subst build_,$(LINUX_VER)-,$(@)) prefix=$(INSTALL_DIR) install +linux: + $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_PATH=$(INSTALL_DIR) install + +linux_%: + $(MAKE) -C linux-$(LINUX_VER)-xen ARCH=xen INSTALL_NAME=$(subst linux_,$(LINUX_VER)-,$(@)) INSTALL_PATH=$(INSTALL_DIR) install world: dist - $(MAKE) config_xenU - $(MAKE) build_xenU - $(MAKE) config_xen0 - $(MAKE) build_xen0 + $(MAKE) linux-$(LINUX_VER)-xen + $(MAKE) linux_xenU_config + $(MAKE) linux_xenU + $(MAKE) linuc_xen0_config + $(MAKE) linux_xen0 clean: delete-symlinks diff --git a/linux-2.4.26-xen-sparse/arch/xen/Makefile b/linux-2.4.26-xen-sparse/arch/xen/Makefile index d29d9d51f3..662a16b9de 100644 --- a/linux-2.4.26-xen-sparse/arch/xen/Makefile +++ b/linux-2.4.26-xen-sparse/arch/xen/Makefile @@ -102,17 +102,15 @@ FORCE: ; bzImage: vmlinux @$(MAKEBOOT) bzImage +INSTALL_NAME ?= $(KERNELRELEASE) install: bzImage - mkdir -p $(prefix)/boot - install -m0644 arch/$(ARCH)/boot/bzImage $(prefix)/boot/vmlinuz-$(INSTALL_NAME) - install -m0644 vmlinux $(prefix)/boot/vmlinux-syms-$(INSTALL_NAME) - install -m0664 .config $(prefix)/boot/config-$(INSTALL_NAME) - -dist: bzImage - mkdir -p ../install/boot - install -m0644 arch/$(ARCH)/boot/bzImage ../install/boot/vmlinuz-$(INSTALL_NAME) - install -m0644 vmlinux ../install/boot/vmlinux-syms-$(INSTALL_NAME) - install -m0664 .config ../install/boot/config-$(INSTALL_NAME) + mkdir -p $(INSTALL_PATH)/boot + install -m0644 arch/$(ARCH)/boot/bzImage $(INSTALL_PATH)/boot/vmlinuz-$(INSTALL_NAME)$(INSTALL_SUFFIX) + install -m0644 vmlinux $(INSTALL_PATH)/boot/vmlinux-syms-$(INSTALL_NAME)$(INSTALL_SUFFIX) + install -m0664 .config $(INSTALL_PATH)/boot/config-$(INSTALL_NAME)$(INSTALL_SUFFIX) + +dist: + $(MAKE) INSTALL_PATH=../install install %_config: arch/xen/defconfig-% rm -f .config arch/xen/defconfig diff --git a/tools/Makefile b/tools/Makefile index 37e373c789..8e9c8e77fd 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -32,5 +32,5 @@ clean: $(MAKE) -C xentrace clean $(MAKE) -C xenctl clean $(MAKE) -C xend clean - $(MAKE) -C xenmgr install + $(MAKE) -C xenmgr clean diff --git a/xen/Makefile b/xen/Makefile index 646a91eb9f..530c76f54e 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -15,13 +15,13 @@ default: $(TARGET) gzip -f -9 < $(TARGET) > $(TARGET).gz debug: - objdump -D -S $(TARGET).dbg > $(TARGET).s + objdump -D -S $(TARGET)-syms > $(TARGET).s install: $(TARGET) gzip -f -9 < $(TARGET) > $(TARGET).gz mkdir -p $(prefix)/boot install -m0644 $(TARGET).gz $(prefix)/boot - install -m0644 $(TARGET).dbg $(prefix)/boot + install -m0644 $(TARGET)-syms $(prefix)/boot dist: $(TARGET) $(MAKE) prefix=`pwd`/../../install dist=yes install diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 8257f479ad..512fc212fc 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -15,8 +15,8 @@ endif # wrapping that with a low-memory bootstrapper.) default: boot/boot.o $(OBJS) $(LD) -r -o arch.o $(OBJS) - $(LD) $(LDFLAGS) boot/boot.o $(ALL_OBJS) -o $(TARGET).dbg - objcopy -R .note -R .comment -S $(TARGET).dbg $(TARGET) + $(LD) $(LDFLAGS) boot/boot.o $(ALL_OBJS) -o $(TARGET)-syms + objcopy -R .note -R .comment -S $(TARGET)-syms $(TARGET) $(BASEDIR)/tools/elf-reloc $(MONITOR_BASE) $(LOAD_BASE) $(TARGET) clean: -- 2.30.2